<template>
  <view class="container">
    <view>姓名:{{ username }}</view>
    <button size="mini" @click="handleChange">点击</button>
  </view>
</template>

<script setup lang="ts">
import { ref, reactive, defineProps } from "vue";
const props = defineProps({
  username: {
    type: String,
    default: "",
  },
  myChange: {
    type: Function,
    required: true,
  },
});

const handleChange = function () {
  //......
  props.myChange("李四");
};
</script>

<style style="less" scoped>
.container {
  height: 500rpx;
  background: yellowgreen;
}
</style>
